

export enum JXEDir {
	/** 站在右边，朝向左边 */
	Left = 1,
	/** 站在左边，朝向右边 */
	Right = -1,
}
export const JXRB_ROLE_NAME_PREFIX = 'JXRBRole';
export const COMMON_ANI_NAME = "COMMON_NAME";
export const JXBattleEffectsRoot = "frames/battle/effect/";
export const JXBattleBuffRoot = "frames/battle/buffs/";

export const JXCollisionRoot = 'frames/battle/collision/';
export const JXBattleBulletRoot = "frames/battle/bullets/";
export const JXBattleSkillSpine = "spine/battle/comskills/";
export const ICampKeyCode = 100;

export const JXRB_ROLE_LAYER_NAME = { LOWER: 'lower', UPPER: 'upper', EFFECT: "effect" };
export const JXStaticEffects: { [key: string]: EffectConfigure } = {
	// buff: { root: JXBattleEffectsRoot, effect: ["buff", "zengyi", 4, 11, 1, 1, 1], name: "buff", loop: false },
	// control: { root: JXBattleEffectsRoot, effect: ["control", "kongzhi", 4, 12, 1, 1, 1], name: "control", loop: false },
	// cure: { root: JXBattleEffectsRoot, effect: ["cure", "buff", 4, 11, 1, 1, 1], name: "cure", loop: false },
	// debuff: { root: JXBattleEffectsRoot, effect: ["debuff", "jianyi", 4, 13, 1, 1, 1], name: "debuff", loop: false },
	// hit: { root: JXBattleEffectsRoot, effect: ["hit", "collision", 4, 5, 1, 1, 1], name: "hit", loop: false, anchor: cc.v2(0.5, 0.5), anchOffset: cc.v2(0, 0.5) },
	// hit1: { root: JXBattleEffectsRoot, effect: ["hit", "shouji", 4, 8, 1, 1, 1], name: "hit1", loop: false, offset: cc.v2(25, -20) },
	// resist: { root: JXBattleEffectsRoot, effect: ["resist", "mianyi", 4, 8, 1, 1, 1], name: "resist", loop: false },
	// tempHp: { root: JXBattleBuffRoot, effect: ["hudun1", "xh", 4, 12, 1, 1, 1], name: 'hudun1', loop: true, offset: cc.v2(0, -20) },
	// coinBuff: { root: JXBattleEffectsRoot, effect: ["guihuo", "buff", 4, 10, 1, 1, 1], name: "coinBuff", loop: false },
	// guihuo: { root: JXBattleEffectsRoot, effect: ["guihuo", "guihuo", 4, 11, 1, 1, 1], name: "guihuo", loop: true },
}

export const JXBuffOrderThreshold = 100;

/** 默认飘字缩放 */
export const DESCRIPT_SCALE = 0.8
/**操作时间 */
export const BTL_CONFIG = {
	ACTION_TIME: 5,
}


export enum JXEState {
	/** 待机 */
	Idle = 0,
	/** 普攻 */
	ComAtk,
	/** 跑（回合无此状态） */
	Run,
	/** 死亡 */
	Death,
	/** 释放技能 */
	Skill,
	/** 受击 */
	Hit,
	/** 技能准备中 */
	Perpare,
	/** 治疗 */
	Real,
	/** 眩晕 */
	Vertigo = 8,
	/** 停帧 */
	StopFrame = 9,
	/** 爆点配合特效 */
	Collision1,

	/** 程序用 */
	Global,

	/** 策划用全局状态 */
	// 变身
	TransSpine = 101,
}

export const JXEAniNames = {
	/**待机 */
	idle: 'idle',
	/**普攻 */
	comAtk: 'atk',
	comAtk_up: "atk_up",
	comAtk_down: "atk_down",
	/**奔跑 */
	run: 'move',
	/**奔跑二 */
	run2: 'move2',
	/**技能*/
	skill: 'skill',
	/**起手式 */
	qishou: 'qishou',
	/**蓄力 */
	prepare: 'xvli',
	/**受击 */
	hit: 'hit',
	/**死亡 */
	die: 'die',
	/**眩晕 */
	vertigo: 'vertigo',
	/**回退 */
	back: "back"
}

/**英雄品质光芒 */
export const JXEHeroBgAniNames = {
	white: 'white',
	blue: 'blue',
	green: 'green',
	purple: 'purple',
	red: 'red',
	yellow: 'yellow',
	shengji: 'shengji',
	heti: 'heti'
}

export const JXEOverAniNames = {
	shengli1: 'shengli1',
	shengli2: 'shengli2',
	shibai1: 'shibai1',
	shibai2: 'shibai2'
}

export const JXEBlessAniNames = {
	hecheng: 'hecheng',
	animation: 'animation'
}


export const JXEAniEventName = {
	Shoot: "shoot",
	Hurt: "hurt",
	Cure: "cure",
	All: "all",
	HitAni: "hitAni",
	Effects: "effects",
	/** 黑场起始 */
	BlackStart: "black_start",
	/** 黑场结束 */
	BlackEnd: "black_end",
	/** 乌云起始 */
	CloudStart: "cloud_start",
	/** 乌云结束 */
	CloudEnd: "cloud_end",
	CaiAtk: "cai_atk",
	CaiSkill: "cai_skill"

}

export const JXSceneEffect: { [key: string]: string } = {
	// train_skill: "spine/battle/scene_effect/trainskill2",
	// gojira_skill: "spine/battle/scene_effect/skill4_1",
	// wuaisi_skill: "spine/battle/scene_effect/wuaisiskill1"
	tuteng: "spine/battle/scene_effect/tuteng"
}

export const JXZcqzEffect = "spine/battle/common/zcqz"
export const SCENE_EFFECT_NODE_NAME = { BLACK: "Black" };

export interface JXCLActionConfigure {
	isSkill?: boolean;
	skillGroup?: number;
	actionId: number;
	isPrepare?: boolean;
	ansInfo: JxAnsInfo;
	effectSk?: string;
}

/** 目的地类型 */
export enum JXETargetPosType {
	/** 技能指向目标 */
	Target,
	/** 释放者阵营前方 */
	SelfCamp,
	/** 目标阵营前方 */
	TargetCamp,
	/** 释放者阵营中心 */
	SelfCenter,
	/** 目标阵营中心 */
	TargetCenter,
	/**目标水平 我方后排 */
	TargetCntAft,
}

export enum JXECollisionEffectFlag {
	/** 跟着表格， 表格没有就没有 */
	Config = 0,
	/** 表格没有就伤害 */
	Damage,
	/** 护盾受击表现 */
	Damage1,
	/** 表格没有就治疗 */
	AddHp,
}


export function JXBattleLog(msg: any, ...args: any[]) {
	CC_DEV && cc.log(msg, ...args);
}

/** 飘字效果 */
export enum DescribeType {
	/** 伤害 */
	Hurt,
	/** 暴击伤害 */
	CritHurt,
	/** 治疗 */
	Cure,
	/** 添加最大血量 */
	MaxHp,
	/** BUFF效果-增益 */
	BuffAdd,
	/** BUFF效果-减益 */
	BuffSub,
	/** 其他BUFF效果 */
	Effect,
}
/** 飘字分组 */
export enum DescribeGroup {
	/** 数值 */
	Number,
	/** 效果 */
	Effect,
}


export const JXRB_LAYER_INDEX = {
	SCENE_EFFECT_LOWER: -1500,
	SHADOW: -1000,
	ROLE: 1000,
	SCENE_EFFECT_UPPER: 1500,
	BLACK: 2000,
	ROLE_SPECIAL: 2100,
	SECEN_BLACK_LAYER: 2500,
	DESCRIBE_LAYER: 2750,
}


export enum JXEBulleType {
	/** 水平直线弹道 */
	Line,
	/** 水平曲线 */
	Curve,
	/** 垂直目标弹道 */
	Vertical,
}


export enum JXEScriptID {
	/** 单次近战，从原地开始播放，到目标结束 */
	OnceNearAtk,
	/** 连续近战攻击（范例） */
	MulNearAtk,
	/** 远程子弹(原地) */
	BulletAtk,
	/** 原地释放 */
	StandAct,
	/**指定路径动作 */
	RoadMoveAct,
	/** 漂移目的地释放 */
	DriftAct,
	/** 原地开始， 目的地结束 */
	SyncMoveAct,
	/** 分段动作 */
	SegmentAct,
	/** 分段动作1 */
	SegmentTAct,
	SegmentNAct,
	/** 漂移到目的地-释放子弹 */
	DriftActBullet,
	/** 原地开始，目的地结束-释放子弹 */
	SyncMoveActBullet,
	/** 光环技能 */
	Ambient,
}


/** 伤害处理类型 */
export enum JXECollsionType {
	/** 针对效果处理，每个效果独立针对目标 */
	Effect,
	/** 多个效果针对一个目标 */
	Siglon,
	/** 针对所有角色 */
	Total,
	/**单人 每个实际产生的效果，针对每个实际效果对应的目标 */
	InsEffect,
}

export const JXMsg = {
	action: {
		scExit: 'JXECLMsg.action.scExit',
		damage: 'JXECLMsg.action.Damage',
		debuger: {
			pause: 'JXECLMsg.action.debuger.pause',
		}
	}

}

export enum JXEBtState {
	NONE,
	ATKER_ACTION,
	ENEMY_ACTION,
	END,
}

export interface JXRoleAction {
	herId: string,
	initiSkillId: 0,
}